<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<!-- saved from url=(0065)http://www.xiami.com/search?key=%E9%82%A3%E4%BA%9B%E5%B9%B4&pos=1 -->
<html lang="zh-CN"><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>享乐音乐搜索</title>
	<meta name="verify-v1" content="gNntuhTm2rH7Qa/GPp6lf0mIp9KQsjejNs+i1LZhG7U=">
	<meta name="keywords" content="享乐音乐搜索">
	<meta name="description" content="享乐音乐搜索">	
		<link href="http://st.xiami.com/??res/v3/css/global.css,res/v3/css/login.css?20120218" rel="stylesheet" media="all">
		<link href="http://st.xiami.com/??res/css/default/main15.css,res/css/default/mode15.css,res/css/default/group15.css,res/css/default/beta15.css?20110105" media="screen" rel="stylesheet">

	<link href="images/icon.gif" type="image/x-icon" rel="shortcut icon">
	<link href="http://img.xiami.com/res/img/common/ipad/xiami_logo_apple.png" rel="apple-touch-icon">
	<link href="http://www.xiami.com/opensearch.xml" type="application/opensearchdescription+xml" rel="search" title="Xiami Search">
	<link rel="alternate" type="application/atom+xml" title="享乐音乐每日精选" href="http://www.xiami.com/collect/feed">
	<!--[if lte IE 8]>
	<link href="http://st.xiami.com/res/v3/css/login_iefix.css?ver=2010122901" rel="stylesheet" media="all" />
	<![endif]-->
		<script type="text/javascript" async="" src="./allFind_files/ga.js"></script><script type="text/javascript" src="./allFind_files/saved_resource"></script>
	<script type="text/javascript" src="./allFind_files/jquery.email-min.js"></script>
	<script src="./js/jquery-1.7.2.min.js" type="text/javascript">
</script>
	<script type="text/javascript">
function searchBlur(who){
	if(who.value == ''){
		who.value = '搜索你想听的音乐....';
		who.parentNode.className = '';
	}
}
function searchFocus(who){
	if(who.value == '搜索你想听的音乐....'){
		who.value = '';
		who.parentNode.className = 'highlight';
	}
}
var mId,mTitle;
function add() {
	$.ajax( {
		url : "mark!listen.action",
		type : "POST",
		data : {
		    id : $("#music_id").html()
		},
		dataType : "json",
		success : function(data) {
			$("#music_listen").html(data.listen + "");
			$("#music_listen").append("<span>试听</span>");
		}
	});
}



function showAddList(title,id){
	mId = id;
	mTitle = title;
	select(0);
}
function closedialog(){
	$('#addList').hide();
	$('#login_popup').hide();
}
function select(i){
	if(i == 0){
		getList();
	}else{
		$('#addList').show();
		$('ul[class="tabs"]> li').removeClass('current');
		$('ul[class="tabs"]> li').eq(1).addClass('current');
		$('div[class="add_clt_main popup_tabitem"]').hide();
		$('div[class="clt_creat_Q popup_tabitem"]').show();
	}
}

function addList(){
	name = $('#clt_name')[0].value;
	des = $('#clt_des')[0].value;
	$.ajax( {
		url : "addListAjax!add.action",
		type : "POST",
		data : {
			listname : name,
			listdescription : des,
		},
		dataType : "json",
		success : function(data){
			if(data.flag == "1"){
				select(0);
			}else{
				alert(data.flag);
			}
		}
	});	
}

function getList(){
	$('ul[class="lists"]').html('');
	$.ajax( {
		url : "addListAjax!get.action",
		type : "POST",
		data : {},
		dataType : "json",
		success : function(data){
			if(data.flag == "没有登录"){
				$('#login_popup').show();
			}else{
				$('#addList').show();
				$.each(data.lists, function(index, value) {
				$('ul[class="lists"]').append('<li><input type="radio" value="'+value.sourceId+'" name="list_id" checked="">'+value.sourceName+'</li>');
				$('div[class="add_clt_main popup_tabitem"]').show();
				$('div[class="clt_creat_Q popup_tabitem"]').hide();
				$('ul[class="tabs"]> li').removeClass('current');
				$('ul[class="tabs"]> li').eq(0).addClass('current');
				});
			}
		}
	});	
}

function addToList(){
	lId=$('input:radio[name="list_id"]:checked').val();
	$.ajax( {
		url : "addToList!add.action",
		type : "POST",
		data : {
			listId:lId,
			musicId:mId
		},
		dataType : "json",
		success : function(data){
			if(data.flag == "0"){
				alert("亲，您忘了您已经添加过了啊");
				closedialog();
			}else{
				closedialog();
			}
		}
	});	
}
function login(){
	$.ajax( {
		url : "loginAjax",
		type : "POST",
		data : {
			username : $('#username')[0].value,
			password : $('#password')[0].value
		},
		dataType : "json",
		success : function(data){
			if(data.flag == 1){
				$('#login_popup').hide();
			}else{
				$('#login_tips').html('用户名或密码错误');
			}
		}
	});
}
</script>
		
<link rel="stylesheet" type="text/css" href="chrome-extension://lfjamigppmepikjlacjdpgjaiojdjhoj/css/menu.css"></head>
<body>
<div id="hidden_obj">
		<embed src="/res/player/sdtos.swf" width="1" height="1" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent" name="trans">
	</div>
<div id="xiami-content"><h1>享乐音乐搜索引擎</h1></div>



<div id="n_header" style="background-image: none;"> 

	<!--usr-->
	<div id="n_header_line" style="border-bottom:0px;">
	<div class="n_header_inner">
		<a href="/ShareMusicProject/">
			<img title="享受音乐  享受快乐"  alt="" src="images/xiang-4.gif" width="102" height="42" style="float: left;padding-top:3px;">
			</a>
			
			<form id="search_box" role="search" method="post" action="/ShareMusicProject/search"> 
				<input type="text" title="搜索你想听的音乐...." value="搜索你想听的音乐...." name="title" id="search_query" autocomplete="off" onblur="searchBlur(this)" onclick="searchFocus(this)">
				<input type="submit" value="" title="搜索" class="" id="search_btn">
			</form>
			
			<ul  style="margin:10px 0 0 10px;list-style:none;float:left;font-size:14px;">
			   <li style="float: left;padding-left:20px;"><a style="color:black;font-weight:bold;text-decoration: none;" title="首页" href="/ShareMusicProject/">首页</a></li>
				<li style="float: left;padding-left:20px;"><a style="color:black;font-weight:bold;Text-decoration:none;" title="发现音乐" href="/ShareMusicProject/allFind.jsp">发现音乐</a></li>
				<li style="float: left; padding-left:20px;"><a style="color:black;font-weight:bold;Text-decoration:none;"  title="分享音乐" href="/ShareMusicProject/findMusic.jsp">分享音乐</a></li>
			</ul>
			<div id="auto_complete" class="old hidden"></div>
			<s:if test="%{#session.user==null}">
				        		<div class="xUser_unlog" style="right: 22px;position: absolute;margin-top: 10px;">
        			<span class="log_orginal"><a href="./register.jsp" >免费注册</a><em>-</em><a href="./login.jsp" ><strong>登录</strong></a></span>
        		</div>

			</s:if>
			<s:else>
				<div class="xUser_logged" style="right: 3px;position: absolute;width:155px;">
		          <ul class="xUser_tabs clearfix">
		            <li><a class="uico_lbry"  href="./my_music.jsp" title="我的音乐库"><i>我的音乐库</i></a></li>
		            <li><a class="uico_collect"  href="./my_lists.jsp" title="我的精选集"><i>我的精选集</i></a></li>
		            <li><a class="uico_home"  href="/ShareMusicProject/home.action?id=${session.user.id}" title="我的个人主页"><img class="r3px" src="./allList_files/usr50.gif" width="16" height="16" alt="我的个人主页"></a></li>
		            <li class="u_more PxRlt"><a class="uico_more"  href="javascript:;" title="更多"><i>更多</i></a>
		              <div class="more_drop hidden">
		                <div class="more_dropInn"><a  href="logOut();">登出</a></div>
		              </div>
		            </li>
		          </ul>
		        </div>
			</s:else>
		</div>
	</div>
	<img src="images/ban.gif" style="background-repeat: repeat-x;height:4px; width:1500px;"/>
	
	<!--shine-->
	
</div>

<style type="text/css">

.track_list tr.same_group td {
  background-color:#fff4ed;
}
.track_list tr.same_group td.chkbox {
  border-left: 2px solid #f60;
}
.track_list a.slide_down,
.track_list a.slide_up {
  display:block;
  width:17px;
  height:17px;
  background-image:url(/res/img/default/slide_group.gif);
  float:right;
  margin: 0 10px 0 0;
}
.track_list a.slide_down {
  background-position:0 0;
}
.track_list a.slide_down:hover {
  background-position:0 -17px;
}
.track_list a.slide_up {
  background-position:0 -34px !important;
}
.track_list a.slide_up:hover {
  background-position:0 -51px !important;
}
.vicos{background:url( http://img.xiami.com/res/img/default/verify_ico.gif) 100% 0 no-repeat; padding-right:18px;}
</style>
<script type="text/javascript">
$(function() {
  $(".track_list tr.same_group:first").show();
  
	$(".track_list a.slide_down").click(function(){
    	$(this).toggleClass("slide_down").toggleClass("slide_up");
		$(this).parents('tbody').next("tbody.same_song_group").toggle().find('input[type=checkbox]').attr('checked','checked');
		
	});
})
function playMusic(src){
	console.log(src);
	            // Check for audio element support.
        if (window.HTMLAudioElement) {
            try {
                var oAudio = document.getElementById('mAudio');
                //console.log(oAudio.src);
                // Tests the paused attribute and set state. 
                if (oAudio.paused) {
                	oAudio.src = "/ShareMusicProject" + src;
                    oAudio.play();
                    //document.getElementById('playIndicator').innerHTML = '立刻暂停';
                }
                else {
                    oAudio.pause();
                    //document.getElementById('playIndicator').innerHTML = '立刻播放';
                }
            }
            catch (e) {
                // Fail silently but show in F12 developer tools console
                 if(window.console && console.error("Error:" + e));
            }
        }
}
$(document).ready(function search() {
    $("#search_text").click(function (){
        $("#search_text").val("");
    });
});

$("#search_query").click(function () {
        $("#search_query").val("");
});
</script>
<audio id="mAudio"></audio>
<div id="page" class="old">
<div id="wrapper">
	<div class="title18_search">
		<h1>搜索音乐</h1>
	</div>
	<div class="more_cols clearfix">
		<div class="more_cols_left">
			<div class="search_box">
				<form class="big_search_form" name="search" id="search" action="search" method="post" autocomplete="off" onsubmit="search_focus();">
					<s:if test="#request.title == null || #request.title.isEmpty()">  
                        <input class="big_search grey" type="text" id="search_text" name="title" value="请输入搜索关键字" />
                    </s:if>  
                    <s:else>    
                        <input class="big_search grey" type="text" id="search_text" name="title" value="${title}" />
                    </s:else>
					<input style="cursor: pointer;" class="big_search_bt" type="submit" title="搜索" value="搜索" id="musicsearch" />
				</form>
			</div>
			
			<div id="on_tour" style="display:none" class="on_tour">演出提醒：<a href="http://www.xiami.com/show/search?key=%E9%82%A3%E4%BA%9B%E5%B9%B4">那些年</a> <a href="http://www.xiami.com/show/search?key=%E9%82%A3%E4%BA%9B%E5%B9%B4" class="on_tour">巡演中</a></div>
			<input type="hidden" name="tour_name" value="那些年" id="tour_name">
									<div class="search_result">
								<div class="search_result_box">
					<h5>歌曲列表</h5>
					<div class="result_main">
						<table class="track_list" cellspacing="0" cellpadding="0">
						    <s:if test="request.music.size() > 0">
						        <thead>
								<tr>
									<th class="chkbox">&nbsp;</th>
									<th class="song_name">歌名</th>
									<th class="song_artist">上传者</th>
									<th class="song_act">&nbsp;</th>
								</tr>
							</thead>
						    </s:if>
							<tbody id="search_music">
							
							<s:if test="#request.music.size() <= 0">
						        <p style="margin: 30px 0 0 280px;font-size: 12px;color: #999;">没有对应的音乐，请重新搜索</p>
						    </s:if>
							
							<s:iterator value="#request.music" id="music" status="i">
							    <tr class=" ">
								<td class="chkbox"><input checked="checked" type="checkbox" value="1770370171" name="recommendids"></td>
								<td class="song_name"><a target="_blank" href="/ShareMusicProject/music?id=<s:property value="#music.sourceId" />" title="<s:property value="#music.sourceName" />"><b class="key_red"><s:property value="#music.sourceName" /></b></a></td>
								<td class="song_artist"><a target="_blank" href="/ShareMusicProject/home?id=<s:property value="#music.targetId" />" title="<s:property value="#music.targetName" />"><s:property value="#music.targetName" /></a></td>
								<td class="song_act">
								    <div class="song_do" style="width:170px;"> <a class="song_play" href="javascript:playMusic('<s:property value="#music.content" />');" title="试听">试听</a>  
								        <a class="song_toclt" href="javascript:showAddList('<s:property value="#music.sourceName" />',<s:property value="#music.sourceId" />);" title="添加">添加</a>
								    </div>
								</td>
							</tr>
							</s:iterator>
                            </tbody>
							
						</table>
					</div>
					<s:if test="#request.music.size() > 0">
					    <div class="chapter_ctrl cd_count">
						<div class="ctrl_play"> <a onclick="selectAll(&#39;recommendids&#39;)" title="" href="javascript:void(0)" class="bt_choose"><span>全选</span></a> <a title="" onclick="inverse(&#39;recommendids&#39;);" href="javascript:void(0);" class="bt_choose"><span>反选</span></a> <a onclick="playsongs(&#39;recommendids&#39;);" title="" href="javascript:void(0);" class="bt_play"><span>播放选中歌曲</span></a> </div>
					</div>
					</s:if>
				 </div>
								<!--album-->
				 
				<!--collect-->
								<div class="search_result_box search_result_box_collect">
					<h5>流派集列表</h5>
					<div class="result_main"> 
						<!--block-->
						<div class="collectBlock_list">
						<ul class="clearfix">
						    <s:if test="#request.playList.size() == 0">
						        <p style="margin: 30px 0 0 280px;font-size: 12px;color: #999;">没有对应的流派集，请重新搜索</p>
						    </s:if>
							<s:iterator value="#request.playList" id="list" status="i">
						        <li>
							    <div class="collect_item100_block">
							        <a target="_blank" class="info" onclick="void();" href="/ShareMusicProject/playList?id=<s:property value="#list.sourceId" />" title="<s:property value="#list.sourceName" />">
								    <p class="cover"><span><img src="<s:property value="#list.sourceImage" />" width="100px" height="120px" alt=""></span></p>
								    <p class="name"><b class="key_red"><s:property value="#list.sourceName" /></b></p>
								    </a>
								    <b class="ico_cd ele_inline"><a target="_blank" title="播放" onclick="void();" href="/ShareMusicProject/playList?id=<s:property value="#list.sourceId" />">播放</a></b>
								    <p style="margin-top: -12px;" class="author">by<a target="_blank" href="/ShareMusicProject/home?id=<s:property value="#list.targetId" />" title="<s:property value="#list.targetName" />"><s:property value="#list.targetName" /></a></p>
							    </div>
						        </li>
						    </s:iterator>
     					</ul>
						</div>
						<!--block-->
						
						<!--page end-->
					</div> </div>
				 </div>
			 </div>
	</div>
</div>
<!--content end-->
</div>
<div id="addList" style="display: none;">
<div style="height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 99998; opacity: 0.5; " class="jqmOverlay"></div>
<div id="dialog_clt" class="dialog_popup jqmID1" style="z-index: 99999; display: block; left: 709px; top: 68px; ">
	<div class="dialog_main"><h3>将 <span id="mTitle"></span>添加到精选集</h3>
<div class="dialog_content">
	<div class="dlg_clt">
		<ul class="tabs">
			<li class="current"><a href="javascript:select(0);" title="">选择精选集</a></li>
			<li ><a href="javascript:select(1);" title="">创建新的精选集</a></li>
		</ul>
		<div class="add_clt_main popup_tabitem"> 			<form action="/song/collect" method="POST" id="form_collect_lists">
				<input type="hidden" name="music_id" id="music_id" value="">
								<ul class="lists">
										<li>
						<input type="radio" value="11740358" name="list_id" checked="">
						阿斯蒂芬 </li>
										<li>
						<input type="radio" value="2665537" name="list_id">
						默认精选集 </li>
										
									</ul>
				<p class="acts">
					<input type="button" onclick="addToList();" class="bt_sub2" name="submit" value="保 存">
					&nbsp;&nbsp;&nbsp;
					<input type="button" class="bt_cancle2" value="取 消" onclick="closedialog();">
				</p>
			</form>
			 </div>
			<div class="clt_creat_Q popup_tabitem" style="display:none">
				<input type="hidden" name="song_id" value="1770934562">
				<p>
					<label class="for_label" for="clt_name">流派集名称：</label>
					<input type="text" class="f_txt" id="clt_name" name="listName">
				</p>
				<p>
					<label class="for_label" for="clt_des">流派集介绍：</label>
					<textarea cols="40" rows="5" id="clt_des" name="listDescription"></textarea>
				</p>
<!-- 
				<p id="validate_code">
					<label  class="for_label" for="validate">验证码：</label>
					<input type="text"  id="validate" class="txt_input r3px" maxlength="4" name="validate" value=""  style="width:50px;" />
					<img src="/coop/checkcode" height="50" align="top"/>
					<span class="hint" style="display:block;margin-left:144px;">输入上述等式结果</span> </p>
				</p>
 -->
				<p class="acts">
					<input type="button" onclick="addList();" name="submit" class="bt_sub2" value="保 存">
				</p>
		</div>
	</div>
</div>
<a class="Closeit" href="javascript:;" title="" onclick="closedialog();">关闭</a> 


 
</div>
	<div class="dialog_sharp">
		<div class="dialog_sharp_top"></div>
		<div class="dialog_sharp_bottom"></div>
	</div>
	<div class="jqDrag"></div>
</div></div>
<div id="login_popup" style="display: none;">
<div style="height: 100%; width: 100%; position: fixed; left: 0px; top: 0px; z-index: 99998; opacity: 0.5; " class="jqmOverlay"></div>
<div id="dialog_clt" class="dialog_popup jqmID1" style="z-index: 99999; display: block; left: 709px; top: 68px; ">
<div class="dialog_main" style="width: 320px"><h3>登录</h3>
<div class="dialog_content">
	<div class="dlg_clt">
			<div class="clt_creat_Q popup_tabitem"  style="margin-left: 20px;margin-right: 20px;font-size: 32px;">
				<input type="hidden" name="song_id" value="1770934562">
				<span id="login_tips"></span>
				<p>
					<label class="for_label" for="clt_name">登录用户名：</label>
					<input type="text" class="f_txt" id="username" name="username">
				</p>
				<p>
					<label class="for_label" for="clt_des">登录密码：</label>
					<input type="password" style="margin-left:11px" id="password" class="f_txt" name="password"/>
				</p>
				<p class="acts">
					<input type="button" onclick="login();" class="bt_sub2" value="登录">
					<input type="button" class="bt_cancle2" value="取 消" onclick="closedialog();">
				</p>
		</div>
	</div>
</div>
</div>
</div> 
</div>
	<div id="footer">
		<div id="foot_wrap" class="clearfix">
		<p class="fl vam gray" id="follow_xiami">关注享乐： 
		<a href="javascript:;" title="新浪微博" rel="nofollow"><i class="social_gray sina"></i></a>
		<a href="javascript:;" title="人人网" rel="nofollow"><i class="social_gray renren"></i></a>
		<a href="javascript:;" title="QQ 空间" rel="nofollow"><i class="social_gray qzone"></i></a>
		<a href="javascript:;" title="腾讯微博" rel="nofollow"><i class="social_gray qqt"></i></a>
		<a href="javascript:;" title="搜狐微博" rel="nofollow"><i class="social_gray 
		sohu"></i></a>
		<a href="" title="豆瓣" rel="nofollow"><i class="social_gray douban"></i></a>	
		</p>
		<p id="copyright" class="fr" style="margin-left: 10px;">
		<img src="images/bottom.gif"/>
		<p style="float: right;">©2012 <a href="/ShareMusicProject">享乐网</a></p>
		</p>
	</div> <!-- #foot_wrap -->
<a id="gotop" href="javascript:void(0);" class="t_hide">Top</a>

<div id="dialog_clt" class="dialog_popup">
	<div class="dialog_main"></div>
	<div class="dialog_sharp">
		<div class="dialog_sharp_top"></div>
		<div class="dialog_sharp_bottom"></div>
	</div>
	<div class="jqDrag"></div>
</div>

<div id="personal_hover" style="display:none;"></div>
<textarea id="personal_hover_tpl" style="display:none;">	&lt;div id="personal_hover_shadow" class="lightShadow"&gt;&lt;/div&gt;
	&lt;div id="personal_hover_inner"&gt;
	&lt;a id="personal_hover_link" href="/u/%uid%" title=" %gmt_access% "&gt;&lt;img id="personal_hover_img" src="%avatar%" /&gt;&lt;/a&gt;
	&lt;img class="hidden" id="personal_hover_pulser_img" src="http://img.xiami.com/res/img/default/loading50x50.gif" width="50" height="50" alt="" /&gt;
	&lt;div id="personal_trigger_bar"&gt;
	&lt;a class="personal_drop" id="personal_menu_down" href="javascript:;" title=""&gt;更多内容&lt;/a&gt;
	&lt;div id="personal_menu_show" class="personal_buddy_menus" style="display:none;"&gt;
	&lt;span class="blank_block"&gt;&lt;/span&gt;
	&lt;p id="personal_relationship_g"&gt;&lt;span class="be_contacts"&gt;&lt;strong&gt;%nick_name%&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
	&lt;div id="personal_menu_other_div"&gt;
		&lt;a id="personal_o_index" class="blocks" href="/u/%uid%" title="%nick_name%的个人主页"&gt;%nick_name%的个人主页&lt;/a&gt;
&lt;!--		&lt;a id="personal_o_minifeed"  class="blocks" href="/space/feed/u/%uid%" title="近况"&gt;近况&lt;/a&gt;--&gt;
		&lt;a id="personal_o_library"  class="blocks" href="/space/lib-song/u/%uid%" title="%nick_name%的音乐库"&gt;音乐库&lt;/a&gt;
        &lt;a id="personal_o_recommend"  class="blocks" href="/space/rec/u/%uid%" title="%nick_name%的分享"&gt;分享&lt;/a&gt;
        &lt;a id="personal_o_contact"  class="blocks" href="/space/following/u/%uid%" title="%nick_name%的关注和粉丝"&gt;关注/粉丝&lt;/a&gt;
		&lt;a id="personal_o_collect"  class="blocks" href="/space/collect/u/%uid%" title="%nick_name%的精选集"&gt;精选集&lt;/a&gt;
&lt;!--		&lt;a id="personal_o_charts"  class="blocks" href="/space/charts/u/%uid%" title="个人排行榜"&gt;个人排行榜&lt;/a&gt;--&gt;
		&lt;a id="personal_o_topic"  class="blocks" href="/space/group-thread/u/%uid%" title="%nick_name%参与过的话题"&gt;参与的话题&lt;/a&gt;
	&lt;/div&gt;
	&lt;a id="personal_msgsned" class="blocks_out" href="/member/sendpm?to_user_id=%uid%" title="发站内信"&gt;发站内信&lt;/a&gt;
	&lt;a id="personal_block_usr" class="blocks_out" href="javascript:;" onclick="blacklist('%uid%','%nick_name%');return false;" title="加入黑名单"&gt;加入黑名单&lt;/a&gt;
	&lt;div id="person_menu_self_div"&gt;&lt;/div&gt;
	&lt;/div&gt;
	&lt;/div&gt;
	&lt;/div&gt;
</textarea>



<script>
;(function($){
	$.fn.personalDropMenu = function(settings){
		var defaults = {
			menuDiv: '#personal_hover',
			tplDiv: '#personal_hover_tpl',
			dropdownArrow:'#personal_menu_down',
			myUid: 0
		};
        
		$.extend(defaults, settings);
        
		var $menuDiv,menuDiv_html,$tplDiv;
		$menuDiv = $(defaults.menuDiv);
		$tplDiv = $(defaults.tplDiv);
		menuDiv_html = $tplDiv.val();//保存原始的html        
		$menuDiv.bind('mouseleave',function(){$(this).hide();});
		window.isFriendshipQueryed=false;
		var friends;
		var setFriendHtml = function(uid,$obj){
			$obj.next().remove();
			if(uid == defaults.myUid) {
				$obj.html('<strong>你自己</strong>');
				$menuDiv.find('#personal_block_usr').remove();
				$menuDiv.find('#personal_msgsned').remove();
			}else if(!friends){
				$obj.after('<span class="be_stranger"><a href="javascript:;" onclick="attention('+uid+',1);">(加关注)</a></span>');
			}else if(friends['f_'+uid] && friends['f_'+uid]=="1"){
				$obj.after('<span class="be_stranger"> 已关注 <a href="/member/attention/uid/'+uid+'/type/2" onclick="return confirm(\'确定要取消吗？\');">(取消关注)</a></span>');
			}else if(friends['f_'+uid] && friends['f_'+uid]=="2"){
				$obj.after('<span class="be_stranger"> 已关注 <a href="/member/attention/uid/'+uid+'/type/2" onclick="return confirm(\'确定要取消吗？\');">(取消关注)</a></span>');
			}else if(friends['f_'+uid] && friends['f_'+uid]=="3"){
				$obj.after('<span class="be_stranger"> 已加入黑名单 <a href="/member/attention/uid/'+uid+'/type/2" onclick="return confirm(\'确定要取消吗？\');">(取消)</a></span>');
				$menuDiv.find('#personal_block_usr').remove();
				$menuDiv.find('#personal_msgsned').remove();
			}else{
				$obj.after('<span class="be_stranger"><a href="javascript:;" onclick="attention('+uid+',1);">(加关注)</a></span>');
			}
		};
        
		return this.each(function(){
			var $this;
			$this = $(this);
			$this.mouseover(function(){
				var params ={
					uid: $this.attr('href').replace('/u/',''),
					avatar: $this.find('img').attr('src'),
					nick_name:$this.attr('title'),
					gmt_access:$this.attr('rel')
				};
				if(params.gmt_access!='') params.gmt_access = "来访时间: "+params.gmt_access;
				var html = menuDiv_html.parseTpl(params);
				var rects = $this[0].getBoundingClientRect();
				var bodyRects = $('body')[0].getBoundingClientRect();
				var left = rects.left - bodyRects.left - 6;
				var top = rects.top - bodyRects.top - 6;
				$menuDiv.css({'top':top,'left':left});
				$menuDiv.html(html).show();
				if(params.gmt_access=='') $menuDiv.find('#personal_hover_link').attr('title','');
				$menuDiv.find(defaults.dropdownArrow).click(function(){
					var $this = $(this);
					var $next = $this.next();
					$this.toggleClass('active')
					$next.toggle();
					if($next.css('display')!='block') return;
					$relation = $next.find('.be_contacts');
					if(params.uid ==defaults.myUid) {setFriendHtml(params.uid,$relation); return; }     
					if(isFriendshipQueryed){ setFriendHtml(params.uid,$relation); return; }                    
					if(!myUid) return;
					$relation.after($loading2);
					$.getJSON('/member/get-friends',function(data){
						try{
							$relation.next().remove();
							if(data.status == 'failed'){return false;}
							isFriendshipQueryed = true;
							friends = data.friends;
							setFriendHtml(params.uid,$relation);
						}catch(e){alert('Warning:something wrong! Please retry!');return;}
					});
				});
			});
		});
	};
})(jQuery);


var myUid = parseInt('2121750');
$('.personalDropDown').personalDropMenu({myUid:myUid});
</script>

 
<script>
$(document).ready(function(){
	$('body').click(function(e){
		$(".ctrl_gears_more").addClass('hidden');
		$(".bt_cdgears").removeClass('active');	
	});
	
	$("#web_loading").remove();

	$(".song_menu").mouseover(function() {
		$(this).css('z-index','6').children('span').show();
	}).mouseout(function() {
		$(this).css('z-index','5').children('span').hide();
	});


	$(".bt_cdgears").mouseover(function(){$(this).addClass('active').next().removeClass('hidden').show();});
	BackTop('gotop');
	if ($.cookie('fools_day') != 1) {
		var now = new Date();
		var close_date = new Date('2012/4/2');
		var begin_date = new Date('2012/4/1');
		if (close_date.getTime()-now.getTime()>0 && now.getTime()-begin_date.getTime()>0) {
			var rabbit_hole = Math.ceil(Math.random()*4);
			if (rabbit_hole != 3) {
				setTimeout(function() {
					$.cookie('fools_day', 1 , { expires: 3, path: '/', domain: '.xiami.com'});
					location.href = 'http://www.xiami.com/event/heavenconcert';
				}, 3000);
			}
		}
	}
});
var BackTop=function(btnId){
	var btn=document.getElementById(btnId);
	var browserName=navigator.userAgent.toLowerCase();
	if(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName)){
	    var d = document.body;
	}else if(/webkit/i.test(browserName) && !this.chrome){
		var d = document.body;
	}else{
	    var d = document.documentElement ? document.documentElement : document.body;
	}
	/*var d = document.documentElement ? document.documentElement : document.body;*/
	window.onscroll=set;
	btn.onclick=function (){
		btn.className = 't_hide';
		window.onscroll=null;
		this.timer=setInterval(function(){
			//d.scrollTop = 0;
			d.scrollTop-=Math.ceil(d.scrollTop*0.8);
			if(d.scrollTop==0) clearInterval(btn.timer,window.onscroll=set);
		},10);
	};
	function set(){
		btn.className = d.scrollTop >= 1620 ? 't_show' : 't_hide';
	}
};
</script> 



<script language="javascript">
$.getJSON('/show/fetchshowscount',{key:$("#tour_name").val()},function(data) {
	if(data.status==1) {
		if(data.count==1) $("#on_tour a").attr("href","/show/detail/id/"+data.id);
		$("#on_tour").show();
	}else {$("#on_tour").remove();}
});
$.ajax({
	  url:'/group/jsonsearch?key=那些年',
	  type: 'GET',
	  dataType: 'json',
	  timeout: 4000,
	  error: function(xml){
		$('#relate_singer').hide();
		},
	success: function(data){
		if(!data) return;
		var related_group_count = 0;
		$.each(data,function(i,group){
			related_group_count++;
			var content = '<li><div class="group_item55_side">';
			content += '<p class="cover"><a href="/group/'+group.group_id+'" title="'+group.title+'"><img src="http://img.xiami.com/'+(group.logo?group.logo:'./res/img/default/cd55.gif')+'"  width="55" height="55"/></a></p>';
			if(group.is_vicos==1) 
				content += '<strong><a  class="vicos" href="/group/'+group.group_id+'" title="'+group.title+'">'+group.title+'</a></strong>';
			else
				content += '<strong><a href="/group/'+group.group_id+'" title="'+group.title+'">'+group.title+'</a></strong>';
			content += '<p class="count count_item">'+group.member_count+'位成员 / '+group.thread_count+'个话题</p></div></li>';
			
			$('#related_groups').append(content);
			
		});
	      
		if(related_group_count>0){
		  $('.search_relate_group').show();
		}
	  }
	 });

function search_focus(condition){
	switch(condition) {
		case 'click':if($('#search_text').val()==$('#search_text').attr('title')){
						$('#search_text').val('');
						$('#search_text').removeClass('grey');
						$("#musicsearch").addClass("hasword");
					 }else {
						$('#search_text').removeClass('grey');
						$("#musicsearch").addClass("hasword");
					 }
					 break;
		case 'blur':if($('#search_text').val()==""){
						$('#search_text').val($('#search_text').attr('title'));
						$("#musicsearch").removeClass("hasword");
						$('#search_text').addClass("grey");
					}
					break;
		default:if($('#search_text').val()==$('#search_text').attr('title')){
					$('#search_text').val('');
					$('#search_text').removeClass('grey');
					$("#musicsearch").addClass("hasword");
				}
	}
}
</script>

﻿﻿﻿﻿﻿</body></html>